﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ID;
using Terraria.Localization;

namespace Terraria.ModLoader
{
	// Token: 0x02000237 RID: 567
	public static class ProjectileLoader
	{
		// Token: 0x06001803 RID: 6147 RVA: 0x0041BB4C File Offset: 0x00419D4C
		private static ProjectileLoader.HookList AddHook<F>(Expression<Func<GlobalProjectile, F>> func)
		{
			ProjectileLoader.HookList hookList = new ProjectileLoader.HookList(ModLoader.Method<GlobalProjectile, F>(func));
			ProjectileLoader.hooks.Add(hookList);
			return hookList;
		}

		// Token: 0x06001804 RID: 6148 RVA: 0x0041BB74 File Offset: 0x00419D74
		internal static int ReserveProjectileID()
		{
			if (ModNet.AllowVanillaClients)
			{
				throw new Exception("Adding projectiles breaks vanilla client compatiblity");
			}
			int result = ProjectileLoader.nextProjectile;
			ProjectileLoader.nextProjectile++;
			return result;
		}

		// Token: 0x170001B7 RID: 439
		// (get) Token: 0x06001805 RID: 6149 RVA: 0x00011D84 File Offset: 0x0000FF84
		public static int ProjectileCount
		{
			get
			{
				return ProjectileLoader.nextProjectile;
			}
		}

		// Token: 0x06001806 RID: 6150 RVA: 0x00011D8B File Offset: 0x0000FF8B
		public static ModProjectile GetProjectile(int type)
		{
			if (type < 714 || type >= ProjectileLoader.ProjectileCount)
			{
				return null;
			}
			return ProjectileLoader.projectiles[type - 714];
		}

		// Token: 0x06001807 RID: 6151 RVA: 0x0041BBA8 File Offset: 0x00419DA8
		internal static void ResizeArrays()
		{
			Array.Resize<bool>(ref Main.projectileLoaded, ProjectileLoader.nextProjectile);
			Array.Resize<Texture2D>(ref Main.projectileTexture, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref Main.projHostile, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref Main.projHook, ProjectileLoader.nextProjectile);
			Array.Resize<int>(ref Main.projFrames, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref Main.projPet, ProjectileLoader.nextProjectile);
			Array.Resize<LocalizedText>(ref Lang._projectileNameCache, ProjectileLoader.nextProjectile);
			Array.Resize<float>(ref ProjectileID.Sets.YoyosLifeTimeMultiplier, ProjectileLoader.nextProjectile);
			Array.Resize<float>(ref ProjectileID.Sets.YoyosMaximumRange, ProjectileLoader.nextProjectile);
			Array.Resize<float>(ref ProjectileID.Sets.YoyosTopSpeed, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.CanDistortWater, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.MinionShot, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.SentryShot, ProjectileLoader.nextProjectile);
			Array.Resize<bool?>(ref ProjectileID.Sets.ForcePlateDetection, ProjectileLoader.nextProjectile);
			Array.Resize<int>(ref ProjectileID.Sets.TrailingMode, ProjectileLoader.nextProjectile);
			Array.Resize<int>(ref ProjectileID.Sets.TrailCacheLength, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.LightPet, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.Homing, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.IsADD2Turret, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.TurretFeature, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.MinionTargettingFeature, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.MinionSacrificable, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.DontAttachHideToAlpha, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.NeedsUUID, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.StardustDragon, ProjectileLoader.nextProjectile);
			Array.Resize<bool>(ref ProjectileID.Sets.NoLiquidDistortion, ProjectileLoader.nextProjectile);
			for (int i = 714; i < ProjectileLoader.nextProjectile; i++)
			{
				Lang._projectileNameCache[i] = LocalizedText.Empty;
				ProjectileID.Sets.YoyosLifeTimeMultiplier[i] = -1f;
				ProjectileID.Sets.YoyosMaximumRange[i] = 200f;
				ProjectileID.Sets.YoyosTopSpeed[i] = 10f;
				ProjectileID.Sets.CanDistortWater[i] = true;
				Main.projectileLoaded[i] = true;
				Main.projFrames[i] = 1;
				ProjectileID.Sets.TrailingMode[i] = -1;
				ProjectileID.Sets.TrailCacheLength[i] = 10;
			}
			Array.Resize<uint[]>(ref Projectile.perIDStaticNPCImmunity, ProjectileLoader.nextProjectile);
			for (int j = 0; j < ProjectileLoader.nextProjectile; j++)
			{
				Projectile.perIDStaticNPCImmunity[j] = new uint[200];
			}
			ProjectileLoader.InstancedGlobals = (from g in ProjectileLoader.globalProjectiles
			where g.InstancePerEntity
			select g).ToArray<GlobalProjectile>();
			for (int k = 0; k < ProjectileLoader.InstancedGlobals.Length; k++)
			{
				ProjectileLoader.InstancedGlobals[k].instanceIndex = k;
			}
			foreach (ProjectileLoader.HookList hookList in ProjectileLoader.hooks)
			{
				hookList.arr = ModLoader.BuildGlobalHook<GlobalProjectile>(ProjectileLoader.globalProjectiles, hookList.method);
			}
		}

		// Token: 0x06001808 RID: 6152 RVA: 0x00011DB0 File Offset: 0x0000FFB0
		internal static void Unload()
		{
			ProjectileLoader.projectiles.Clear();
			ProjectileLoader.nextProjectile = 714;
			ProjectileLoader.globalProjectiles.Clear();
			ProjectileLoader.globalIndexes.Clear();
			ProjectileLoader.globalIndexesByType.Clear();
		}

		// Token: 0x06001809 RID: 6153 RVA: 0x00011DE4 File Offset: 0x0000FFE4
		internal static bool IsModProjectile(Projectile projectile)
		{
			return projectile.type >= 714;
		}

		// Token: 0x0600180A RID: 6154 RVA: 0x0041BE84 File Offset: 0x0041A084
		internal static void SetDefaults(Projectile projectile, bool createModProjectile = true)
		{
			if (ProjectileLoader.IsModProjectile(projectile) && createModProjectile)
			{
				projectile.modProjectile = ProjectileLoader.GetProjectile(projectile.type).NewInstance(projectile);
			}
			projectile.globalProjectiles = (from g in ProjectileLoader.InstancedGlobals
			select g.NewInstance(projectile)).ToArray<GlobalProjectile>();
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.SetDefaults();
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookSetDefaults.arr)
			{
				globalProjectile.Instance(projectile).SetDefaults(projectile);
			}
		}

		// Token: 0x0600180B RID: 6155 RVA: 0x0041BF44 File Offset: 0x0041A144
		internal static GlobalProjectile GetGlobalProjectile(Projectile projectile, Mod mod, string name)
		{
			int index;
			if (!ProjectileLoader.globalIndexes.TryGetValue(mod.Name + ":" + name, out index))
			{
				return null;
			}
			return ProjectileLoader.globalProjectiles[index].Instance(projectile);
		}

		// Token: 0x0600180C RID: 6156 RVA: 0x0041BF84 File Offset: 0x0041A184
		internal static GlobalProjectile GetGlobalProjectile(Projectile projectile, Type type)
		{
			int num;
			if (!ProjectileLoader.globalIndexesByType.TryGetValue(type, out num))
			{
				return null;
			}
			if (num <= -1)
			{
				return null;
			}
			return ProjectileLoader.globalProjectiles[num].Instance(projectile);
		}

		// Token: 0x0600180D RID: 6157 RVA: 0x0041BFBC File Offset: 0x0041A1BC
		public static void ProjectileAI(Projectile projectile)
		{
			if (ProjectileLoader.PreAI(projectile))
			{
				int type = projectile.type;
				bool flag = projectile.modProjectile != null && projectile.modProjectile.aiType > 0;
				if (flag)
				{
					projectile.type = projectile.modProjectile.aiType;
				}
				projectile.VanillaAI();
				if (flag)
				{
					projectile.type = type;
				}
				ProjectileLoader.AI(projectile);
			}
			ProjectileLoader.PostAI(projectile);
		}

		// Token: 0x0600180E RID: 6158 RVA: 0x0041C024 File Offset: 0x0041A224
		public static bool PreAI(Projectile projectile)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPreAI.arr)
			{
				if (!globalProjectile.Instance(projectile).PreAI(projectile))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.PreAI();
		}

		// Token: 0x0600180F RID: 6159 RVA: 0x0041C074 File Offset: 0x0041A274
		public static void AI(Projectile projectile)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.AI();
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookAI.arr)
			{
				globalProjectile.Instance(projectile).AI(projectile);
			}
		}

		// Token: 0x06001810 RID: 6160 RVA: 0x0041C0BC File Offset: 0x0041A2BC
		public static void PostAI(Projectile projectile)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.PostAI();
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPostAI.arr)
			{
				globalProjectile.Instance(projectile).PostAI(projectile);
			}
		}

		// Token: 0x06001811 RID: 6161 RVA: 0x0041C104 File Offset: 0x0041A304
		public static byte[] SendExtraAI(Projectile projectile, ref BitsByte flags)
		{
			if (projectile.modProjectile != null)
			{
				byte[] array;
				using (MemoryStream memoryStream = new MemoryStream())
				{
					using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
					{
						projectile.modProjectile.SendExtraAI(binaryWriter);
						binaryWriter.Flush();
						array = memoryStream.ToArray();
					}
				}
				if (array.Length != 0)
				{
					flags[Projectile.maxAI + 1] = true;
				}
				return array;
			}
			return new byte[0];
		}

		// Token: 0x06001812 RID: 6162 RVA: 0x00011DF6 File Offset: 0x0000FFF6
		public static byte[] ReadExtraAI(BinaryReader reader, BitsByte flags)
		{
			if (flags[Projectile.maxAI + 1])
			{
				return reader.ReadBytes((int)reader.ReadByte());
			}
			return new byte[0];
		}

		// Token: 0x06001813 RID: 6163 RVA: 0x0041C18C File Offset: 0x0041A38C
		public static void ReceiveExtraAI(Projectile projectile, byte[] extraAI)
		{
			if (extraAI.Length != 0 && projectile.modProjectile != null)
			{
				using (MemoryStream memoryStream = new MemoryStream(extraAI))
				{
					using (BinaryReader binaryReader = new BinaryReader(memoryStream))
					{
						projectile.modProjectile.ReceiveExtraAI(binaryReader);
					}
				}
			}
		}

		// Token: 0x06001814 RID: 6164 RVA: 0x0041C1F4 File Offset: 0x0041A3F4
		public static bool ShouldUpdatePosition(Projectile projectile)
		{
			if (ProjectileLoader.IsModProjectile(projectile) && !projectile.modProjectile.ShouldUpdatePosition())
			{
				return false;
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookShouldUpdatePosition.arr)
			{
				if (!globalProjectile.Instance(projectile).ShouldUpdatePosition(projectile))
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x06001815 RID: 6165 RVA: 0x0041C248 File Offset: 0x0041A448
		public static bool TileCollideStyle(Projectile projectile, ref int width, ref int height, ref bool fallThrough)
		{
			if (ProjectileLoader.IsModProjectile(projectile) && !projectile.modProjectile.TileCollideStyle(ref width, ref height, ref fallThrough))
			{
				return false;
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookTileCollideStyle.arr)
			{
				if (!globalProjectile.Instance(projectile).TileCollideStyle(projectile, ref width, ref height, ref fallThrough))
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x06001816 RID: 6166 RVA: 0x0041C2A4 File Offset: 0x0041A4A4
		public static bool OnTileCollide(Projectile projectile, Vector2 oldVelocity)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookOnTileCollide.arr)
			{
				if (!globalProjectile.Instance(projectile).OnTileCollide(projectile, oldVelocity))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.OnTileCollide(oldVelocity);
		}

		// Token: 0x06001817 RID: 6167 RVA: 0x0041C2F8 File Offset: 0x0041A4F8
		public static bool? CanCutTiles(Projectile projectile)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanCutTiles.arr)
			{
				bool? flag = globalProjectile.Instance(projectile).CanCutTiles(projectile);
				if (flag != null)
				{
					return new bool?(flag.Value);
				}
			}
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile == null)
			{
				return null;
			}
			return modProjectile.CanCutTiles();
		}

		// Token: 0x06001818 RID: 6168 RVA: 0x0041C360 File Offset: 0x0041A560
		public static void CutTiles(Projectile projectile)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCutTiles.arr)
			{
				globalProjectile.Instance(projectile).CutTiles(projectile);
			}
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile == null)
			{
				return;
			}
			modProjectile.CutTiles();
		}

		// Token: 0x06001819 RID: 6169 RVA: 0x0041C3A8 File Offset: 0x0041A5A8
		public static bool PreKill(Projectile projectile, int timeLeft)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPreKill.arr)
			{
				if (!globalProjectile.Instance(projectile).PreKill(projectile, timeLeft))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.PreKill(timeLeft);
		}

		// Token: 0x0600181A RID: 6170 RVA: 0x0041C3FC File Offset: 0x0041A5FC
		public static void Kill(Projectile projectile, int timeLeft)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.Kill(timeLeft);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookKill.arr)
			{
				globalProjectile.Instance(projectile).Kill(projectile, timeLeft);
			}
		}

		// Token: 0x0600181B RID: 6171 RVA: 0x0041C448 File Offset: 0x0041A648
		public static bool CanDamage(Projectile projectile)
		{
			if (projectile.modProjectile != null && !projectile.modProjectile.CanDamage())
			{
				return false;
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanDamage.arr)
			{
				if (!globalProjectile.Instance(projectile).CanDamage(projectile))
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x0600181C RID: 6172 RVA: 0x0041C49C File Offset: 0x0041A69C
		public static bool MinionContactDamage(Projectile projectile)
		{
			if (projectile.modProjectile != null && projectile.modProjectile.MinionContactDamage())
			{
				return true;
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookMinionContactDamage.arr)
			{
				if (globalProjectile.Instance(projectile).MinionContactDamage(projectile))
				{
					return true;
				}
			}
			return false;
		}

		// Token: 0x0600181D RID: 6173 RVA: 0x0041C4F0 File Offset: 0x0041A6F0
		public static void ModifyDamageHitbox(Projectile projectile, ref Rectangle hitbox)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.ModifyDamageHitbox(ref hitbox);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookModifyDamageHitbox.arr)
			{
				globalProjectile.Instance(projectile).ModifyDamageHitbox(projectile, ref hitbox);
			}
		}

		// Token: 0x0600181E RID: 6174 RVA: 0x0041C53C File Offset: 0x0041A73C
		public static bool? CanHitNPC(Projectile projectile, NPC target)
		{
			bool? result = null;
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanHitNPC.arr)
			{
				bool? flag = globalProjectile.Instance(projectile).CanHitNPC(projectile, target);
				if (flag != null && !flag.Value)
				{
					return new bool?(false);
				}
				if (flag != null)
				{
					result = new bool?(flag.Value);
				}
			}
			if (projectile.modProjectile != null)
			{
				bool? flag2 = projectile.modProjectile.CanHitNPC(target);
				if (flag2 != null && !flag2.Value)
				{
					return new bool?(false);
				}
				if (flag2 != null)
				{
					result = new bool?(flag2.Value);
				}
			}
			return result;
		}

		// Token: 0x0600181F RID: 6175 RVA: 0x0041C5F8 File Offset: 0x0041A7F8
		public static void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.ModifyHitNPC(target, ref damage, ref knockback, ref crit, ref hitDirection);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookModifyHitNPC.arr)
			{
				globalProjectile.Instance(projectile).ModifyHitNPC(projectile, target, ref damage, ref knockback, ref crit, ref hitDirection);
			}
		}

		// Token: 0x06001820 RID: 6176 RVA: 0x0041C650 File Offset: 0x0041A850
		public static void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.OnHitNPC(target, damage, knockback, crit);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookOnHitNPC.arr)
			{
				globalProjectile.Instance(projectile).OnHitNPC(projectile, target, damage, knockback, crit);
			}
		}

		// Token: 0x06001821 RID: 6177 RVA: 0x0041C6A4 File Offset: 0x0041A8A4
		public static bool CanHitPvp(Projectile projectile, Player target)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanHitPvp.arr)
			{
				if (!globalProjectile.Instance(projectile).CanHitPvp(projectile, target))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.CanHitPvp(target);
		}

		// Token: 0x06001822 RID: 6178 RVA: 0x0041C6F8 File Offset: 0x0041A8F8
		public static void ModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.ModifyHitPvp(target, ref damage, ref crit);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookModifyHitPvp.arr)
			{
				globalProjectile.Instance(projectile).ModifyHitPvp(projectile, target, ref damage, ref crit);
			}
		}

		// Token: 0x06001823 RID: 6179 RVA: 0x0041C748 File Offset: 0x0041A948
		public static void OnHitPvp(Projectile projectile, Player target, int damage, bool crit)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.OnHitPvp(target, damage, crit);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookOnHitPvp.arr)
			{
				globalProjectile.Instance(projectile).OnHitPvp(projectile, target, damage, crit);
			}
		}

		// Token: 0x06001824 RID: 6180 RVA: 0x0041C798 File Offset: 0x0041A998
		public static bool CanHitPlayer(Projectile projectile, Player target)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanHitPlayer.arr)
			{
				if (!globalProjectile.Instance(projectile).CanHitPlayer(projectile, target))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.CanHitPlayer(target);
		}

		// Token: 0x06001825 RID: 6181 RVA: 0x0041C7EC File Offset: 0x0041A9EC
		public static void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.ModifyHitPlayer(target, ref damage, ref crit);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookModifyHitPlayer.arr)
			{
				globalProjectile.Instance(projectile).ModifyHitPlayer(projectile, target, ref damage, ref crit);
			}
		}

		// Token: 0x06001826 RID: 6182 RVA: 0x0041C83C File Offset: 0x0041AA3C
		public static void OnHitPlayer(Projectile projectile, Player target, int damage, bool crit)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.OnHitPlayer(target, damage, crit);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookOnHitPlayer.arr)
			{
				globalProjectile.Instance(projectile).OnHitPlayer(projectile, target, damage, crit);
			}
		}

		// Token: 0x06001827 RID: 6183 RVA: 0x0041C88C File Offset: 0x0041AA8C
		public static bool? Colliding(Projectile projectile, Rectangle projHitbox, Rectangle targetHitbox)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookColliding.arr)
			{
				bool? flag = globalProjectile.Instance(projectile).Colliding(projectile, projHitbox, targetHitbox);
				if (flag != null)
				{
					return new bool?(flag.Value);
				}
			}
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile == null)
			{
				return null;
			}
			return modProjectile.Colliding(projHitbox, targetHitbox);
		}

		// Token: 0x06001828 RID: 6184 RVA: 0x00011E1B File Offset: 0x0001001B
		public static void DrawHeldProjInFrontOfHeldItemAndArms(Projectile projectile, ref bool flag)
		{
			if (projectile.modProjectile != null)
			{
				flag = projectile.modProjectile.drawHeldProjInFrontOfHeldItemAndArms;
			}
		}

		// Token: 0x06001829 RID: 6185 RVA: 0x0041C8F8 File Offset: 0x0041AAF8
		public static Color? GetAlpha(Projectile projectile, Color lightColor)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookGetAlpha.arr)
			{
				Color? alpha = globalProjectile.Instance(projectile).GetAlpha(projectile, lightColor);
				if (alpha != null)
				{
					return alpha;
				}
			}
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile == null)
			{
				return null;
			}
			return modProjectile.GetAlpha(lightColor);
		}

		// Token: 0x0600182A RID: 6186 RVA: 0x00011E32 File Offset: 0x00010032
		public static void DrawOffset(Projectile projectile, ref int offsetX, ref int offsetY, ref float originX)
		{
			if (projectile.modProjectile != null)
			{
				offsetX = projectile.modProjectile.drawOffsetX;
				offsetY = -projectile.modProjectile.drawOriginOffsetY;
				originX += projectile.modProjectile.drawOriginOffsetX;
			}
		}

		// Token: 0x0600182B RID: 6187 RVA: 0x0041C958 File Offset: 0x0041AB58
		public static bool PreDrawExtras(Projectile projectile, SpriteBatch spriteBatch)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPreDrawExtras.arr)
			{
				if (!globalProjectile.Instance(projectile).PreDrawExtras(projectile, spriteBatch))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.PreDrawExtras(spriteBatch);
		}

		// Token: 0x0600182C RID: 6188 RVA: 0x0041C9AC File Offset: 0x0041ABAC
		public static bool PreDraw(Projectile projectile, SpriteBatch spriteBatch, Color lightColor)
		{
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPreDraw.arr)
			{
				if (!globalProjectile.Instance(projectile).PreDraw(projectile, spriteBatch, lightColor))
				{
					return false;
				}
			}
			return projectile.modProjectile == null || projectile.modProjectile.PreDraw(spriteBatch, lightColor);
		}

		// Token: 0x0600182D RID: 6189 RVA: 0x0041CA00 File Offset: 0x0041AC00
		public static void PostDraw(Projectile projectile, SpriteBatch spriteBatch, Color lightColor)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.PostDraw(spriteBatch, lightColor);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookPostDraw.arr)
			{
				globalProjectile.Instance(projectile).PostDraw(projectile, spriteBatch, lightColor);
			}
		}

		// Token: 0x0600182E RID: 6190 RVA: 0x0041CA4C File Offset: 0x0041AC4C
		public static bool? CanUseGrapple(int type, Player player)
		{
			ModProjectile projectile = ProjectileLoader.GetProjectile(type);
			bool? result = (projectile != null) ? projectile.CanUseGrapple(player) : null;
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookCanUseGrapple.arr)
			{
				bool? flag = globalProjectile.CanUseGrapple(type, player);
				if (flag != null)
				{
					result = flag;
				}
			}
			return result;
		}

		// Token: 0x0600182F RID: 6191 RVA: 0x0041CAAC File Offset: 0x0041ACAC
		public static bool? SingleGrappleHook(int type, Player player)
		{
			ModProjectile projectile = ProjectileLoader.GetProjectile(type);
			bool? result = (projectile != null) ? projectile.SingleGrappleHook(player) : null;
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookSingleGrappleHook.arr)
			{
				bool? flag = globalProjectile.SingleGrappleHook(type, player);
				if (flag != null)
				{
					result = flag;
				}
			}
			return result;
		}

		// Token: 0x06001830 RID: 6192 RVA: 0x0041CB0C File Offset: 0x0041AD0C
		public static void UseGrapple(Player player, ref int type)
		{
			ModProjectile projectile = ProjectileLoader.GetProjectile(type);
			if (projectile != null)
			{
				projectile.UseGrapple(player, ref type);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookUseGrapple.arr)
			{
				globalProjectile.UseGrapple(player, ref type);
			}
		}

		// Token: 0x06001831 RID: 6193 RVA: 0x0041CB54 File Offset: 0x0041AD54
		public static bool GrappleOutOfRange(float distance, Projectile projectile)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			return distance > ((modProjectile != null) ? new float?(modProjectile.GrappleRange()) : null);
		}

		// Token: 0x06001832 RID: 6194 RVA: 0x0041CB94 File Offset: 0x0041AD94
		public static void NumGrappleHooks(Projectile projectile, Player player, ref int numHooks)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.NumGrappleHooks(player, ref numHooks);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookNumGrappleHooks.arr)
			{
				globalProjectile.Instance(projectile).NumGrappleHooks(projectile, player, ref numHooks);
			}
		}

		// Token: 0x06001833 RID: 6195 RVA: 0x0041CBE0 File Offset: 0x0041ADE0
		public static void GrappleRetreatSpeed(Projectile projectile, Player player, ref float speed)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.GrappleRetreatSpeed(player, ref speed);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookGrappleRetreatSpeed.arr)
			{
				globalProjectile.Instance(projectile).GrappleRetreatSpeed(projectile, player, ref speed);
			}
		}

		// Token: 0x06001834 RID: 6196 RVA: 0x0041CC2C File Offset: 0x0041AE2C
		public static void GrapplePullSpeed(Projectile projectile, Player player, ref float speed)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.GrapplePullSpeed(player, ref speed);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookGrapplePullSpeed.arr)
			{
				globalProjectile.Instance(projectile).GrapplePullSpeed(projectile, player, ref speed);
			}
		}

		// Token: 0x06001835 RID: 6197 RVA: 0x0041CC78 File Offset: 0x0041AE78
		internal static void DrawBehind(Projectile projectile, int index, List<int> drawCacheProjsBehindNPCsAndTiles, List<int> drawCacheProjsBehindNPCs, List<int> drawCacheProjsBehindProjectiles, List<int> drawCacheProjsOverWiresUI)
		{
			ModProjectile modProjectile = projectile.modProjectile;
			if (modProjectile != null)
			{
				modProjectile.DrawBehind(index, drawCacheProjsBehindNPCsAndTiles, drawCacheProjsBehindNPCs, drawCacheProjsBehindProjectiles, drawCacheProjsOverWiresUI);
			}
			foreach (GlobalProjectile globalProjectile in ProjectileLoader.HookDrawBehind.arr)
			{
				globalProjectile.Instance(projectile).DrawBehind(projectile, index, drawCacheProjsBehindNPCsAndTiles, drawCacheProjsBehindNPCs, drawCacheProjsBehindProjectiles, drawCacheProjsOverWiresUI);
			}
		}

		// Token: 0x06001836 RID: 6198 RVA: 0x00011E67 File Offset: 0x00010067
		private static bool HasMethod(Type t, string method, params Type[] args)
		{
			return t.GetMethod(method, args).DeclaringType != typeof(GlobalProjectile);
		}

		// Token: 0x06001837 RID: 6199 RVA: 0x0041CCD0 File Offset: 0x0041AED0
		internal static void VerifyGlobalProjectile(GlobalProjectile projectile)
		{
			Type type = projectile.GetType();
			bool flag = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Any((FieldInfo f) => f.DeclaringType != typeof(GlobalProjectile));
			if (flag && !projectile.InstancePerEntity)
			{
				throw new Exception(type + " has instance fields but does not set InstancePerEntity to true. Either use static fields, or per instance globals");
			}
		}

		// Token: 0x04001674 RID: 5748
		private static int nextProjectile = 714;

		// Token: 0x04001675 RID: 5749
		internal static readonly IList<ModProjectile> projectiles = new List<ModProjectile>();

		// Token: 0x04001676 RID: 5750
		internal static readonly IList<GlobalProjectile> globalProjectiles = new List<GlobalProjectile>();

		// Token: 0x04001677 RID: 5751
		internal static GlobalProjectile[] InstancedGlobals = new GlobalProjectile[0];

		// Token: 0x04001678 RID: 5752
		internal static readonly IDictionary<string, int> globalIndexes = new Dictionary<string, int>();

		// Token: 0x04001679 RID: 5753
		internal static readonly IDictionary<Type, int> globalIndexesByType = new Dictionary<Type, int>();

		// Token: 0x0400167A RID: 5754
		private static List<ProjectileLoader.HookList> hooks = new List<ProjectileLoader.HookList>();

		// Token: 0x0400167B RID: 5755
		private static ProjectileLoader.HookList HookSetDefaults = ProjectileLoader.AddHook<Action<Projectile>>((GlobalProjectile g) => (Action<Projectile>)Delegate.CreateDelegate(typeof(Action<Projectile>), g, methodof(GlobalProjectile.SetDefaults(Projectile))));

		// Token: 0x0400167C RID: 5756
		private static ProjectileLoader.HookList HookPreAI = ProjectileLoader.AddHook<Func<Projectile, bool>>((GlobalProjectile g) => (Func<Projectile, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, bool>), g, methodof(GlobalProjectile.PreAI(Projectile))));

		// Token: 0x0400167D RID: 5757
		private static ProjectileLoader.HookList HookAI = ProjectileLoader.AddHook<Action<Projectile>>((GlobalProjectile g) => (Action<Projectile>)Delegate.CreateDelegate(typeof(Action<Projectile>), g, methodof(GlobalProjectile.AI(Projectile))));

		// Token: 0x0400167E RID: 5758
		private static ProjectileLoader.HookList HookPostAI = ProjectileLoader.AddHook<Action<Projectile>>((GlobalProjectile g) => (Action<Projectile>)Delegate.CreateDelegate(typeof(Action<Projectile>), g, methodof(GlobalProjectile.PostAI(Projectile))));

		// Token: 0x0400167F RID: 5759
		private static ProjectileLoader.HookList HookShouldUpdatePosition = ProjectileLoader.AddHook<Func<Projectile, bool>>((GlobalProjectile g) => (Func<Projectile, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, bool>), g, methodof(GlobalProjectile.ShouldUpdatePosition(Projectile))));

		// Token: 0x04001680 RID: 5760
		private static ProjectileLoader.HookList HookTileCollideStyle = ProjectileLoader.AddHook<ProjectileLoader.DelegateTileCollideStyle>((GlobalProjectile g) => (ProjectileLoader.DelegateTileCollideStyle)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateTileCollideStyle), g, methodof(GlobalProjectile.TileCollideStyle(Projectile, int*, int*, bool*))));

		// Token: 0x04001681 RID: 5761
		private static ProjectileLoader.HookList HookOnTileCollide = ProjectileLoader.AddHook<Func<Projectile, Vector2, bool>>((GlobalProjectile g) => (Func<Projectile, Vector2, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, Vector2, bool>), g, methodof(GlobalProjectile.OnTileCollide(Projectile, Vector2))));

		// Token: 0x04001682 RID: 5762
		private static ProjectileLoader.HookList HookCanCutTiles = ProjectileLoader.AddHook<Func<Projectile, bool?>>((GlobalProjectile g) => (Func<Projectile, bool?>)Delegate.CreateDelegate(typeof(Func<Projectile, bool?>), g, methodof(GlobalProjectile.CanCutTiles(Projectile))));

		// Token: 0x04001683 RID: 5763
		private static ProjectileLoader.HookList HookCutTiles = ProjectileLoader.AddHook<Action<Projectile>>((GlobalProjectile g) => (Action<Projectile>)Delegate.CreateDelegate(typeof(Action<Projectile>), g, methodof(GlobalProjectile.CutTiles(Projectile))));

		// Token: 0x04001684 RID: 5764
		private static ProjectileLoader.HookList HookPreKill = ProjectileLoader.AddHook<Func<Projectile, int, bool>>((GlobalProjectile g) => (Func<Projectile, int, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, int, bool>), g, methodof(GlobalProjectile.PreKill(Projectile, int))));

		// Token: 0x04001685 RID: 5765
		private static ProjectileLoader.HookList HookKill = ProjectileLoader.AddHook<Action<Projectile, int>>((GlobalProjectile g) => (Action<Projectile, int>)Delegate.CreateDelegate(typeof(Action<Projectile, int>), g, methodof(GlobalProjectile.Kill(Projectile, int))));

		// Token: 0x04001686 RID: 5766
		private static ProjectileLoader.HookList HookCanDamage = ProjectileLoader.AddHook<Func<Projectile, bool>>((GlobalProjectile g) => (Func<Projectile, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, bool>), g, methodof(GlobalProjectile.CanDamage(Projectile))));

		// Token: 0x04001687 RID: 5767
		private static ProjectileLoader.HookList HookMinionContactDamage = ProjectileLoader.AddHook<Func<Projectile, bool>>((GlobalProjectile g) => (Func<Projectile, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, bool>), g, methodof(GlobalProjectile.MinionContactDamage(Projectile))));

		// Token: 0x04001688 RID: 5768
		private static ProjectileLoader.HookList HookModifyDamageHitbox = ProjectileLoader.AddHook<ProjectileLoader.DelegateModifyDamageHitbox>((GlobalProjectile g) => (ProjectileLoader.DelegateModifyDamageHitbox)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateModifyDamageHitbox), g, methodof(GlobalProjectile.ModifyDamageHitbox(Projectile, Rectangle*))));

		// Token: 0x04001689 RID: 5769
		private static ProjectileLoader.HookList HookCanHitNPC = ProjectileLoader.AddHook<Func<Projectile, NPC, bool?>>((GlobalProjectile g) => (Func<Projectile, NPC, bool?>)Delegate.CreateDelegate(typeof(Func<Projectile, NPC, bool?>), g, methodof(GlobalProjectile.CanHitNPC(Projectile, NPC))));

		// Token: 0x0400168A RID: 5770
		private static ProjectileLoader.HookList HookModifyHitNPC = ProjectileLoader.AddHook<ProjectileLoader.DelegateModifyHitNPC>((GlobalProjectile g) => (ProjectileLoader.DelegateModifyHitNPC)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateModifyHitNPC), g, methodof(GlobalProjectile.ModifyHitNPC(Projectile, NPC, int*, float*, bool*, int*))));

		// Token: 0x0400168B RID: 5771
		private static ProjectileLoader.HookList HookOnHitNPC = ProjectileLoader.AddHook<Action<Projectile, NPC, int, float, bool>>((GlobalProjectile g) => (Action<Projectile, NPC, int, float, bool>)Delegate.CreateDelegate(typeof(Action<Projectile, NPC, int, float, bool>), g, methodof(GlobalProjectile.OnHitNPC(Projectile, NPC, int, float, bool))));

		// Token: 0x0400168C RID: 5772
		private static ProjectileLoader.HookList HookCanHitPvp = ProjectileLoader.AddHook<Func<Projectile, Player, bool>>((GlobalProjectile g) => (Func<Projectile, Player, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, Player, bool>), g, methodof(GlobalProjectile.CanHitPvp(Projectile, Player))));

		// Token: 0x0400168D RID: 5773
		private static ProjectileLoader.HookList HookModifyHitPvp = ProjectileLoader.AddHook<ProjectileLoader.DelegateModifyHitPvp>((GlobalProjectile g) => (ProjectileLoader.DelegateModifyHitPvp)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateModifyHitPvp), g, methodof(GlobalProjectile.ModifyHitPvp(Projectile, Player, int*, bool*))));

		// Token: 0x0400168E RID: 5774
		private static ProjectileLoader.HookList HookOnHitPvp = ProjectileLoader.AddHook<Action<Projectile, Player, int, bool>>((GlobalProjectile g) => (Action<Projectile, Player, int, bool>)Delegate.CreateDelegate(typeof(Action<Projectile, Player, int, bool>), g, methodof(GlobalProjectile.OnHitPvp(Projectile, Player, int, bool))));

		// Token: 0x0400168F RID: 5775
		private static ProjectileLoader.HookList HookCanHitPlayer = ProjectileLoader.AddHook<Func<Projectile, Player, bool>>((GlobalProjectile g) => (Func<Projectile, Player, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, Player, bool>), g, methodof(GlobalProjectile.CanHitPlayer(Projectile, Player))));

		// Token: 0x04001690 RID: 5776
		private static ProjectileLoader.HookList HookModifyHitPlayer = ProjectileLoader.AddHook<ProjectileLoader.DelegateModifyHitPlayer>((GlobalProjectile g) => (ProjectileLoader.DelegateModifyHitPlayer)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateModifyHitPlayer), g, methodof(GlobalProjectile.ModifyHitPlayer(Projectile, Player, int*, bool*))));

		// Token: 0x04001691 RID: 5777
		private static ProjectileLoader.HookList HookOnHitPlayer = ProjectileLoader.AddHook<Action<Projectile, Player, int, bool>>((GlobalProjectile g) => (Action<Projectile, Player, int, bool>)Delegate.CreateDelegate(typeof(Action<Projectile, Player, int, bool>), g, methodof(GlobalProjectile.OnHitPlayer(Projectile, Player, int, bool))));

		// Token: 0x04001692 RID: 5778
		private static ProjectileLoader.HookList HookColliding = ProjectileLoader.AddHook<Func<Projectile, Rectangle, Rectangle, bool?>>((GlobalProjectile g) => (Func<Projectile, Rectangle, Rectangle, bool?>)Delegate.CreateDelegate(typeof(Func<Projectile, Rectangle, Rectangle, bool?>), g, methodof(GlobalProjectile.Colliding(Projectile, Rectangle, Rectangle))));

		// Token: 0x04001693 RID: 5779
		private static ProjectileLoader.HookList HookGetAlpha = ProjectileLoader.AddHook<Func<Projectile, Color, Color?>>((GlobalProjectile g) => (Func<Projectile, Color, Color?>)Delegate.CreateDelegate(typeof(Func<Projectile, Color, Color?>), g, methodof(GlobalProjectile.GetAlpha(Projectile, Color))));

		// Token: 0x04001694 RID: 5780
		private static ProjectileLoader.HookList HookPreDrawExtras = ProjectileLoader.AddHook<Func<Projectile, SpriteBatch, bool>>((GlobalProjectile g) => (Func<Projectile, SpriteBatch, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, SpriteBatch, bool>), g, methodof(GlobalProjectile.PreDrawExtras(Projectile, SpriteBatch))));

		// Token: 0x04001695 RID: 5781
		private static ProjectileLoader.HookList HookPreDraw = ProjectileLoader.AddHook<Func<Projectile, SpriteBatch, Color, bool>>((GlobalProjectile g) => (Func<Projectile, SpriteBatch, Color, bool>)Delegate.CreateDelegate(typeof(Func<Projectile, SpriteBatch, Color, bool>), g, methodof(GlobalProjectile.PreDraw(Projectile, SpriteBatch, Color))));

		// Token: 0x04001696 RID: 5782
		private static ProjectileLoader.HookList HookPostDraw = ProjectileLoader.AddHook<Action<Projectile, SpriteBatch, Color>>((GlobalProjectile g) => (Action<Projectile, SpriteBatch, Color>)Delegate.CreateDelegate(typeof(Action<Projectile, SpriteBatch, Color>), g, methodof(GlobalProjectile.PostDraw(Projectile, SpriteBatch, Color))));

		// Token: 0x04001697 RID: 5783
		private static ProjectileLoader.HookList HookCanUseGrapple = ProjectileLoader.AddHook<Func<int, Player, bool?>>((GlobalProjectile g) => (Func<int, Player, bool?>)Delegate.CreateDelegate(typeof(Func<int, Player, bool?>), g, methodof(GlobalProjectile.CanUseGrapple(int, Player))));

		// Token: 0x04001698 RID: 5784
		private static ProjectileLoader.HookList HookSingleGrappleHook = ProjectileLoader.AddHook<Func<int, Player, bool?>>((GlobalProjectile g) => (Func<int, Player, bool?>)Delegate.CreateDelegate(typeof(Func<int, Player, bool?>), g, methodof(GlobalProjectile.SingleGrappleHook(int, Player))));

		// Token: 0x04001699 RID: 5785
		private static ProjectileLoader.HookList HookUseGrapple = ProjectileLoader.AddHook<ProjectileLoader.DelegateUseGrapple>((GlobalProjectile g) => (ProjectileLoader.DelegateUseGrapple)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateUseGrapple), g, methodof(GlobalProjectile.UseGrapple(Player, int*))));

		// Token: 0x0400169A RID: 5786
		private static ProjectileLoader.HookList HookNumGrappleHooks = ProjectileLoader.AddHook<ProjectileLoader.DelegateNumGrappleHooks>((GlobalProjectile g) => (ProjectileLoader.DelegateNumGrappleHooks)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateNumGrappleHooks), g, methodof(GlobalProjectile.NumGrappleHooks(Projectile, Player, int*))));

		// Token: 0x0400169B RID: 5787
		private static ProjectileLoader.HookList HookGrappleRetreatSpeed = ProjectileLoader.AddHook<ProjectileLoader.DelegateGrappleRetreatSpeed>((GlobalProjectile g) => (ProjectileLoader.DelegateGrappleRetreatSpeed)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateGrappleRetreatSpeed), g, methodof(GlobalProjectile.GrappleRetreatSpeed(Projectile, Player, float*))));

		// Token: 0x0400169C RID: 5788
		private static ProjectileLoader.HookList HookGrapplePullSpeed = ProjectileLoader.AddHook<ProjectileLoader.DelegateGrapplePullSpeed>((GlobalProjectile g) => (ProjectileLoader.DelegateGrapplePullSpeed)Delegate.CreateDelegate(typeof(ProjectileLoader.DelegateGrapplePullSpeed), g, methodof(GlobalProjectile.GrapplePullSpeed(Projectile, Player, float*))));

		// Token: 0x0400169D RID: 5789
		private static ProjectileLoader.HookList HookDrawBehind = ProjectileLoader.AddHook<Action<Projectile, int, List<int>, List<int>, List<int>, List<int>>>((GlobalProjectile g) => (Action<Projectile, int, List<int>, List<int>, List<int>, List<int>>)Delegate.CreateDelegate(typeof(Action<Projectile, int, List<int>, List<int>, List<int>, List<int>>), g, methodof(GlobalProjectile.DrawBehind(Projectile, int, List<int>, List<int>, List<int>, List<int>))));

		// Token: 0x02000238 RID: 568
		private class HookList
		{
			// Token: 0x06001839 RID: 6201 RVA: 0x00011E85 File Offset: 0x00010085
			public HookList(MethodInfo method)
			{
				this.method = method;
			}

			// Token: 0x0400169E RID: 5790
			public GlobalProjectile[] arr = new GlobalProjectile[0];

			// Token: 0x0400169F RID: 5791
			public readonly MethodInfo method;
		}

		// Token: 0x02000239 RID: 569
		// (Invoke) Token: 0x0600183B RID: 6203
		private delegate bool DelegateTileCollideStyle(Projectile projectile, ref int width, ref int height, ref bool fallThrough);

		// Token: 0x0200023A RID: 570
		// (Invoke) Token: 0x0600183F RID: 6207
		private delegate void DelegateModifyDamageHitbox(Projectile projectile, ref Rectangle hitbox);

		// Token: 0x0200023B RID: 571
		// (Invoke) Token: 0x06001843 RID: 6211
		private delegate void DelegateModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection);

		// Token: 0x0200023C RID: 572
		// (Invoke) Token: 0x06001847 RID: 6215
		private delegate void DelegateModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit);

		// Token: 0x0200023D RID: 573
		// (Invoke) Token: 0x0600184B RID: 6219
		private delegate void DelegateModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit);

		// Token: 0x0200023E RID: 574
		// (Invoke) Token: 0x0600184F RID: 6223
		private delegate void DelegateUseGrapple(Player player, ref int type);

		// Token: 0x0200023F RID: 575
		// (Invoke) Token: 0x06001853 RID: 6227
		private delegate void DelegateNumGrappleHooks(Projectile projectile, Player player, ref int numHooks);

		// Token: 0x02000240 RID: 576
		// (Invoke) Token: 0x06001857 RID: 6231
		private delegate void DelegateGrappleRetreatSpeed(Projectile projectile, Player player, ref float speed);

		// Token: 0x02000241 RID: 577
		// (Invoke) Token: 0x0600185B RID: 6235
		private delegate void DelegateGrapplePullSpeed(Projectile projectile, Player player, ref float speed);
	}
}
